<?php

include('login_validation.php');
include('functions.php');

$bgcolor = "#229CBA";



if (isset($_POST['save']) && $_POST['save'] == "save") {

	$idCongress = getValor('ID_CONGRESS');

	$query = sprintf("UPDATE CONGRESS SET WELCOME = %s WHERE ID_CONGRESS = %s",
					(GetSQLValueString(getValor('welcome'), "text")),
					(GetSQLValueString($idCongress, "int")));
					
	executeUpdateQuery($query);

	$success = "The welcome message has been succefully updated";

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

	<title>CONGRESS ADMIN - WELCOME MESSAGE</title>

	<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
	<link href="accordion/style.css" rel="stylesheet" type="text/css" media="screen" />

	<script src="accordion/accordian.pack.js" language="javascript" type="text/javascript">
	</script>

	<style>
		body {
			padding: 0px;
			margin: 0px;
		}
		
		.bodybg {
			background: <?php echo $bgcolor; ?>
			filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='<?php echo $bgcolor; ?>', endColorstr='#FFFFFF');
			background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $bgcolor; ?>), to(#FFFFFF));
			background: -moz-linear-gradient(top,  <?php echo $bgcolor ?>,  #FFFFFF);
			width:100%;
			height: 600px;
		}
	</style>

	<script type="text/javascript" src="jscolor/jscolor.js"></script>
	<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
	<script type="text/javascript" src="tiny_mice.js"></script>
</head>

<body>

	<div align="center" class="bodybg">

		<?php include('admin_header.php'); ?>

		<?php include('admin_menu.php'); ?>
		
		<?php include('congress_select.php'); ?>
		
		<div style="width: 870px; background-color: #B6D490; padding: 5px;" align="left">
			<table style="font-size: 9px;" width="100%">
				<tr>
					<td>
						WELCOME MESSAGE
					</td>
				</tr>
			</table>
		</div>


		
	  	<div id="basic-accordian" style="background-color: white;">
		
			<?php if (isset($success)) { include('success.php'); } ?>
			
			<?php if (getValor('ID_CONGRESS') != "") { ?>	
			
				<?php $congress_row = obtenerCongress(getValor('ID_CONGRESS')); ?>
			
				<form method="post" name="form1" action="<?php echo $_SERVER['PHP_SELF']; ?>">
				
					<table align="center">
						<tr>
							<td>
								<textarea id="welcome" name="welcome"><?php echo $congress_row['WELCOME']; ?></textarea>
							</td>
						</tr>
						<tr>
							<td align="right">  
								<input type="submit" name="save" value="Save" />
							</td>
						</tr>
					</table>
					<input type="hidden" name="ID_CONGRESS" value="<?php echo getValor('ID_CONGRESS'); ?>" />
					<input type="hidden" name="save" value="save" />
				</form>
				<p>&nbsp;</p>
			
			<?php } ?>
	  </div>
		
	</div>

</body>
</html>
